<!--
 * Tencent is pleased to support the open source community by making 蓝鲸 available.
 * Copyright (C) 2017 Tencent. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language governing permissions and
 * limitations under the License.
-->

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>loading</title>
    <script>
      (function () {
        // 直调PaaS接口时，如果本平台为https,PaaS为http，则需要在head中声明如下的meta才能避免被csp拦截
        if (window.location.protocol.startsWith('https')) {
          var meta = document.createElement('meta')
          meta.setAttribute('http-equiv', 'Content-Security-Policy')
          meta.setAttribute('content', 'upgrade-insecure-requests')
          document.head.appendChild(meta)
        }
      })();
    </script>
    <link rel="shortcut icon" type="image/x-icon">
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
    <script type="text/javascript">
        window.Site = {
            url: <%= htmlWebpackPlugin.options.config.API_URL %>,
            version: <%= htmlWebpackPlugin.options.config.API_VERSION %>,
            login: <%= htmlWebpackPlugin.options.config.API_LOGIN %>,
            agent: <%= htmlWebpackPlugin.options.config.AGENT_URL %>,
            authscheme: <%= htmlWebpackPlugin.options.config.AUTH_SCHEME || 'internal' %>,
            buildVersion: '<%= htmlWebpackPlugin.options.config.BUILD_VERSION %>',
            fullTextSearch: <%= htmlWebpackPlugin.options.config.FULL_TEXT_SEARCH || 'off' %>,
            helpDocUrl: <%= htmlWebpackPlugin.options.config.HELP_DOC_URL || null %>,
            disableOperationStatistic: <%= htmlWebpackPlugin.options.config.DISABLE_OPERATION_STATISTIC || false %>,
            cookieDomain: <%= htmlWebpackPlugin.options.config.COOKIE_DOMAIN %>,
            componentApiUrl: <%= htmlWebpackPlugin.options.config.COMPONENT_API_URL %>,
            publicPath: <%= htmlWebpackPlugin.options.config.PUBLIC_PATH %>,
            enableNotification: <%= htmlWebpackPlugin.options.config.ENABLE_NOTIFICATION %>,
            sharedResUrl: <%= htmlWebpackPlugin.options.config.SHARED_RES_URL %>
        }
        window.User = {
            admin: <%= htmlWebpackPlugin.options.config.USER_ROLE %>,
            name: <%= htmlWebpackPlugin.options.config.USER_NAME %>
        }
        window.Supplier = {
            account: '0'
        }
        window.ESB = {
          userManage: <%= htmlWebpackPlugin.options.config.USER_MANAGE %>
        }
        window.API_HOST = Site.buildVersion.indexOf('dev') !== -1 ? Site.url : (window.location.origin + window.location.pathname)
        window.API_PREFIX = API_HOST + 'api/' + Site.version
    </script>
  </body>
</html>
